<?php
class AppModel extends Model{

    public function increment($field, $id = null, $increment = 1)
    {
      if (is_null($id)) {
        $id = $this->id;
      }

      return $this->updateAll(
        array($this->escapeField($field) => $this->escapeField($field) . '+' . $increment),
        array($this->escapeField() => $id)
      );
    }
}
?>
